<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title></title>
        <link rel="stylesheet" href="popup_sidebar.css">
        <script src="https://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
        <script src="popup_sidebar.js"></script>
        <link type="text/css" href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
        <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
        <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
        <script src="https://res.dcdev.net/dcdev/v1.0.6/assets/js/render_somthing.js"></script>
    </head>
    <body>
        <div id="popup_sidebar_music"></div>
        <button id="popup_sidebar_music_btn" type="button" class="btn btn-primary">弹出</button>
        <script>
            var data = {
                //弹窗组件生成区域 div id
                id: "popup_sidebar_music",
                //弹窗方向，左边，右边，下边，上边
                direction: 'left',
                //弹窗宽度 （请带单位，px vw）
                width: '400px',
                //弹窗高度（请带单位，px vh）
                height: '100vh',
                //弹窗样式
                style: 'overflow: scroll;z-index:9999;box-shadow:4px 4px 5px #999;background-color:black;opacity: 1;color: #fff;',
                //关闭按钮样式
                close_style: `margin:5px;`,
                //弹窗内容
                content: `
                    <div id="controldiv"  style="height:100%;background-color: black;display: flex;flex-direction:column;align-items: center;">
                    <div style="color: white;font-size: 80px;margin: 10px;">远程控制</div>
                    <div style="width: 100%;height: 100%;" id="render_somthing_control_list"></div>

                    
                </div>
                    `,
                callback: {
                    //点击事件
                    click: function (res) {
                        console.log(res);
                    },
                    //点击弹窗外事件
                    click_out_popup_sidebar: function (res) {
                        console.log(res);
                    },
                    //点击关闭弹窗事件
                    click_close_popup_sidebar: function (res) {
                        console.log(res);
                    }
                }
            };
            var popup_sidebar_music = new popup_sidebar();
            popup_sidebar_music.init(data);
            $('#popup_sidebar_music_btn').click(function (event) {
                popup_sidebar_music.popup();
            });
        </script>
        <script>
            var render_somthing_control_list;
            render_somthing_control_list = new render_somthing();
            render_somthing_control_list.init({
                // div的id
                id: "#render_somthing_control_list",
                // x/y/flow   分别为x向滚动、y向滚动、瀑布流
                method: "x",
                // 容器是指即将渲染内容的外围容器，可以为div/table/ul ...
                container: {
                    html: `
                    <div style="width:100%;height:100%;display: flex;flex-direction: column;align-items: center;"></div>
        `
                },
                // 渲染内容的配置
                content: {
                    default: `
                    #{html}
        `,

                },
                callback: {
                    click: function (res) {
                        if (res.key == "cycy") {
                            console.log(res.node);
                        }
                    }
                }
            })
            render_somthing_control_list.render([{
                    html:`<div style="width: 90%;margin:10px;" class="card bg-primary text-white">
                        <div class="card-body">
                            <h1>音乐控制</h1>
                            <hr style="background-color: white;">
                            <div style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
                                <button  onclick="index.quick_send('upmusic','noip')"  type="button" class="btn btn-primary">上一首</button>
                                <button  onclick="index.quick_send('play','noip')"  type="button" class="btn btn-primary">播放</button>
                                <button  onclick="index.quick_send('downmusic','noip')"  type="button" class="btn btn-primary">下一首</button>
                            </div>
                        </div>
                    </div>`
                },
                {
                    html:`<div style="width: 90%;margin:10px;" class="card bg-primary text-white">
                        <div class="card-body">
                            <h1>视频控制</h1>
                            <hr style="background-color: white;">
                            <div style="display: flex;flex-direction: row;align-items: center;justify-content: center;">
                                <button  onclick="index.quick_send('upmusic','noip')"  type="button" class="btn btn-primary">快退</button>
                                <button  onclick="index.quick_send('play','noip')"  type="button" class="btn btn-primary">播放</button>
                                <button  onclick="index.quick_send('downmusic','noip')"  type="button" class="btn btn-primary">快进</button>
                            </div>
                        </div>
                    </div>`
                },
                {
                    html:`<div style="width: 90%;margin:10px;" class="card bg-primary text-white">
                        <div class="card-body">
                            <h1>消息队列</h1>
                            <hr style="background-color: white;">
                            <div style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
                                <h6>正在播放：我爱你.mp3</h6>
                            </div>
                        </div>
                    </div>`
                },
                {
                    html:`<div style="width: 90%;margin:10px;" class="card bg-primary text-white">
                        <div class="card-body">
                            <h1>消息</h1>
                            <hr style="background-color: white;">
                            <div style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
                                <h6>------------------</h6>
                            </div>
                        </div>
                    </div>`
                },{
                    html:`<div style="width: 90%;margin:10px;" class="card bg-primary text-white">
                        <div class="card-body">
                            <h1>消息</h1>
                            <hr style="background-color: white;">
                            <div style="display: flex;flex-direction: column;align-items: center;justify-content: center;">
                                <h6>------------------</h6>
                            </div>
                        </div>
                    </div>`
                }
            ]);
        </script>
    </body>
</html>